<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<title>设置推送内容</title>
	<link rel="stylesheet" href="/layui/css/layui.css">
	<style type="text/css">
		.pushSOP_main_contaienr{
			width: 485px;
			margin: 0 auto;
			padding: 32px 32px 32px 0;
			background: #fff;
		}
		.pushSOP_title{
			font-size: 17px;
			width: 100%;
			text-align: center;
			margin-top: 2px;
			font-weight: 600;
			line-height: 24px;
			letter-spacing: 1px;
			padding-left: 20px;
		}

		.pushSOP_header_contaienr{
			margin-top: 24px;
		}
		.pushSOP_publicTitle{
			font-size: 14px;
			font-weight: 600;
			color: rgba(0,0,0,.85);
			line-height: 22px;
			padding-left: 7px;
			position: relative;
			margin-bottom: 8px;
		}
		.pushSOP_publicTitle::before{
			position: absolute;
			content: "";
			display: block;
			width: 3px;
			height: 13px;
			background: #e0e4e8;
			left: 0;
			top: 50%;
			-webkit-transform: translateY(-50%);
			transform: translateY(-50%);
		}
		.pushSOP_header_contaienr input{
			-webkit-box-sizing: border-box;
			box-sizing: border-box;
			margin: 0;
			font-variant: tabular-nums;
			list-style: none;
			-webkit-font-feature-settings: "tnum";
			font-feature-settings: "tnum";
			position: relative;
			display: inline-block;
			width: 100%;
			height: 32px;
			padding: 4px 11px;
			color: rgba(0,0,0,.65);
			font-size: 14px;
			line-height: 1.5;
			background-color: #fff;
			background-image: none;
			border: 1px solid #d9d9d9;
			border-radius: 4px;
			-webkit-transition: all .3s;
			transition: all .3s;
			margin-left: 12px;
		}
		.pushSOP_button_container{
			display: flex;
			justify-content: space-between;
			padding-top: 10px;
			align-items: center;
		}
		.pushSOP_button_content{
			display: flex;
			justify-content: flex-end;
			flex: 1;
			align-items: center;
		}
		.pushSOP_setSendTime_contaienr{
			margin-top: 10px;
		}
		.pushSOP_setSendTime_content{
			display: flex;
			align-items: center;
			padding-left: 12px;
			margin-top: 6px;
		}
		.pushSOP_setSendTime_content span{
			color: rgba(0,0,0,.65);
			font-size: 14px;
			padding: 0 8px;
		}
		.pushSOP_setSendTime_check{
			width: 16px;
			height: 16px;
			padding-right: 8px;
		}
		.pushSOP_setSendTime_input{
			width: 66px;
			height: 25px;
			color: rgba(0,0,0,.65);
			font-size: 14px;
			background-color: #fff;
			background-image: none;
			-webkit-transition: all .3s;
			transition: all .3s;
			border: 1px solid #d9d9d9;
			border-radius: 4px;
			padding: 0 11px;
			box-sizing: border-box;
		}
		.pushSOP_sendContent_contaienr{
			margin-top: 10px;
		}
		.pushSOP_message_content{
			position: relative;
		}
		.pushSOP_sendNav_container{
			display: flex;
			align-items: center;
			margin-top: 10px;
		}
		.pushSOP_sendNav_container p{
			color: rgba(0,0,0,.65);
			font-size: 14px;
		}
		.pushSOP_sendNav_container input{

		}
		.pushSOP_sendNavRadio{
			display: flex;
			align-items: center;
			margin-right: 8px;
		}
		.pushSOP_sendNavRadio input{
			width: 16px;
			height: 16px;
		}
		.pushSOP_sendNavRadio span{
			color: rgba(0,0,0,.65);
			font-size: 14px;
			padding: 0 8px;
		}
		.pushSOP_sendContent_content{
			margin-top: 10px;
			padding-left: 46px;
		}
		.punlic_sendContent_container{
			padding: 16px 12px;
			min-height: 112px;
			box-sizing: border-box;
			background: #fbfbfb;
			border: 1px solid #eee;
		}
		.pushSOP_sendContentText_container{
			
		}
		.pushSOP_sendContentText_container0 textarea{
			width: 100%;
			height: 100%;
			border: none;
			resize: none;
			outline: none;
			font-size: 14px;
			font-weight: 400;
			color: rgba(0,0,0,.85);
			line-height: 20px;
			box-sizing: border-box;
			overflow: auto;
			background: #fbfbfb;
		}
		.pushSOP_sendContentImg_container{
			
		}
		
		.pushSOP_sendContentLink_container0{
			padding: 12px;
			/*width: 505px;*/
			height: 50px;
			box-sizing: border-box;
			background: #fbfbfb;
			/*border: 1px solid #eee;*/
			display: -webkit-box;
			display: flex;
			-webkit-box-align: center;
			align-items: center;
			min-height:50px;
		}
		.pushSOP_sendContentLink_container0 input{
			border: none!important;
			background: #fbfbfb;
			outline: none;
			box-shadow: none;
			width: 100%;
			height: 32px;
			padding: 4px 11px;
			color: rgba(0,0,0,.65);
			font-size: 14px;
		}
		.pushSOP_sendContent_contaienr svg{
			position: absolute;
			right: 0;
			top: 3px;
			padding: 2px;
			cursor: pointer;
			background: #f0f0f0;
		}
		.pushSOP_leftButton_content button{
			color: #1E9FFF;
			border-color: #1E9FFF;
		}
		.pushSOP_leftButton_content button:hover{
			color: #1E9FFF;
			border-color: #1E9FFF;
		}
	</style>
</head>
<body>
	<form class="" action="" id="form1">
		<div class="pushSOP_main_contaienr">
			<h2 class="pushSOP_title">设置推送内容</h2>

			<div class="pushSOP_header_contaienr">
				<h4 class="pushSOP_publicTitle">设置内容名称：</h4>
				<input type="text" placeholder="设置内容名称，仅内部可见" name="topname">
			</div>

			<div class="pushSOP_setSendTime_contaienr">
				<h4 class="pushSOP_publicTitle">设置发送时间：</h4>
				<div class="pushSOP_setSendTime_content">
					<input type="radio" name="time" value="now" checked class="pushSOP_setSendTime_check">
					<span>加入规则后</span>
					<input type="text" name="xiaoshi" value="0" class="pushSOP_setSendTime_input">
					<span>小时</span>
					<input type="text" name="fenzhong" value="30" class="pushSOP_setSendTime_input">
					<span>分钟后提醒</span>
				</div>

				<div class="pushSOP_setSendTime_content">
					<input type="radio" name="time" value="next" class="pushSOP_setSendTime_check">
					<span>加入规则后</span>
					<input type="text" name="tianshu" value="1" class="pushSOP_setSendTime_input">
					<span>天后，当日</span>
					<input type="text" name="shijian" class="pushSOP_setSendTime_input" id="time4" placeholder="00:00:00" style="width: 80px;">
					<!-- <input type="text" name="" value="30" class="pushSOP_setSendTime_input"> -->
					<span>提醒发送</span>
				</div>

			</div>

			<div class="pushSOP_sendContent_contaienr">
				<h4 class="pushSOP_publicTitle">设置发送内容：</h4>
				<div class="pushSOP_message_container">
					<div class="pushSOP_message_content">
						<svg class="pushSOP_sendContentSvg" data-id="0" t="1607330001680" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11923" width="16" height="16"><path d="M888 262.3H136.8c-17.9 0-32.4-14.5-32.4-32.4s14.5-32.4 32.4-32.4H888c17.9 0 32.4 14.5 32.4 32.4s-14.5 32.4-32.4 32.4z" fill="#666666" p-id="11924"></path><path d="M749.2 895.5H269.8c-45.4 0-82.3-36.9-82.3-82.3V257.6c0-17.9 14.5-32.4 32.4-32.4s32.4 14.5 32.4 32.4v555.7c0 9.5 8 17.5 17.5 17.5h479.4c9.5 0 17.4-8 17.4-17.5V257.6c0-17.9 14.5-32.4 32.4-32.4s32.4 14.5 32.4 32.4v555.7c0.1 45.3-36.8 82.2-82.2 82.2z" fill="#666666" p-id="11925"></path><path d="M386.5 709.6c-17.9 0-32.4-14.5-32.4-32.4V415.3c0-17.9 14.5-32.4 32.4-32.4s32.4 14.5 32.4 32.4v261.9c0 17.9-14.5 32.4-32.4 32.4zM509.5 709.6c-17.9 0-32.4-14.5-32.4-32.4V415.3c0-17.9 14.5-32.4 32.4-32.4s32.4 14.5 32.4 32.4v261.9c0 17.9-14.5 32.4-32.4 32.4zM632.6 709.6c-17.9 0-32.4-14.5-32.4-32.4V415.3c0-17.9 14.5-32.4 32.4-32.4s32.4 14.5 32.4 32.4v261.9c0 17.9-14.5 32.4-32.4 32.4zM660 249.9c-17.9 0-32.4-14.5-32.4-32.4v-41.6c0-12.7-10.3-23.1-23.1-23.1h-190c-12.7 0-23.1 10.3-23.1 23.1v41.6c0 17.9-14.5 32.4-32.4 32.4s-32.4-14.5-32.4-32.4v-41.6c0-48.5 39.4-87.9 87.9-87.9h190.1c48.5 0 87.9 39.4 87.9 87.9v41.6c0 17.9-14.5 32.4-32.5 32.4z" fill="#616161" p-id="11926"></path></svg>
						<div class="pushSOP_sendNav_container">
							<p>消息1：</p>
							<div class="pushSOP_sendNavRadio">
								 <input type="radio" name="sendContent0" value="文字" title="文字" checked="" class="sendContentRadio">
								 <span>文字</span>
							</div>
							<div class="pushSOP_sendNavRadio">
								 <input type="radio" name="sendContent0" value="图片" title="图片" class="sendContentRadio">
								 <span>图片</span>
							</div>
							<div class="pushSOP_sendNavRadio">
								 <input type="radio" name="sendContent0" value="链接" title="链接" class="sendContentRadio">
								 <span>链接</span>
							</div>
							
						</div>
						<div class="pushSOP_sendContent_content">
							<!-- 文字 -->
							<div class="pushSOP_sendContentText_container0 punlic_sendContent_container0">
								<textarea name="text0" placeholder="请输入内容"></textarea>
							</div>
							<!-- 图片 -->
							<div class="pushSOP_sendContentImg_container0 punlic_sendContent_container0" style="display: none;">
							<!-- 	<div class="layui-upload-drag" data-value="1111"  id="test0" data-id="tt0">
								  <i class="layui-icon" style="color: #1e9fff;"></i>
								  <p>点击上传，或将文件拖拽到此处</p>
								  <div class="layui-hide" id="uploadDemoView0">
								    <hr>
								    <img src="" alt="上传成功后渲染" style="max-width: 196px">
								      <img class="layui-upload-img" id="demo0" > <input type="hidden" id="demo0" name="file0" /> 
								  </div>
								</div>-->
			                    <button type="button" class="layui-btn layui-btnssss" data-id="tt0" id="test0">上传图片</button>
			                    <input type="file" hidden id="hide0" />
			                    <div class="layui-upload-list">
			                        <img class="layui-upload-img" id="demo0" style="width: 100px;">
			                        <input type="hidden" id="demos0" name="file0" />
			                        <p id="demoText0"></p>
			                    </div>
					        </div>	
							<!-- 链接 -->
							<div class="pushSOP_sendContentLink_container0 punlic_sendContent_container0" style="display: none;">
								<input type="text" name="url0" placeholder="请输入链接">
							</div>
						</div>
					</div>
				</div>
				
			</div>

			<div class="layui-form-item pushSOP_button_container">
				<div class="pushSOP_leftButton_content">
					<button type="button" class="layui-btn layui-btn-primary layui-btn-sm">+ 添加发送内容</button>
				</div>
				<div class="pushSOP_button_content">
					<button type="button" class="layui-btn layui-btn-primary layui-btn-sm quxiaosss">取消</button>
					<button type="button" class="layui-btn layui-btn-normal layui-btn-sm sub-tijiao">设置</button>
				</div>
			</div>
		</div>	
	</form>
	<!-- <script src="/layui/layui.js"></script> -->
	<script src="/layui/layui.all.js"></script>
	<script>

	//表单
	layui.use('form', function(){
		var form = layui.form;

	  //监听提交
	  form.on('submit(formDemo)', function(data){
	  	layer.msg(JSON.stringify(data.field));
	  	return false;
	  });

	});
	// 上传
	

//拖拽上传
// $('.pushSOP_message_container').on('click','.layui-upload-drag',function(e){
// 	for (var q = 0; q<mycars.length; q++) {
// 		var ane = $('.layui-upload-drag').data('id');
// 		var bna = 'tt'+mycars[q];
// 		var id = mycars[q];
// 		if(ane == bna){
// 			layui.use('upload', function(){
// 			var upload = layui.upload;
// 				upload.render({
// 					elem: "test"+id
// 		    		,url: 'https://httpbin.org/post' //改成您自己的上传接口
// 		    		,done: function(res){
// 		    			layer.msg('上传成功');
// 		    			layui.$('#uploadDemoView'+id).removeClass('layui-hide').find('img').attr('src', res.files.file);
// 		    			console.log(res)
// 		    		}
// 		    	});

// 			})
			
// 		}
// 	}
// })
	// 时间选择器
	layui.use('laydate', function(){
		var laydate = layui.laydate;
  		//时间选择器
  		laydate.render({
  			elem: '#time4'
  			,type: 'time'
  		});
  	});
</script>
<script src="/cdn/jquery.js"></script>
<script src="/red/lib/layui.js"></script>
<script src="/js/ajax.js"></script>
<script type="text/javascript">
	//删除
	$('.pushSOP_message_container').on('click','.pushSOP_sendContentSvg',function(e){
		var id = $(this).data("id");
		mycars.splice(id,1); 
		$(this).parent().remove();
	})

	$('.pushSOP_message_container').on('click','.sendContentRadio',function(e){
		// console.log(mycars);
		for (var i = 0; i< mycars.length; i++) {
			let type = $("input[name='sendContent"+mycars[i]+"']:checked").val();
			if(type == "文字"){
				$('.punlic_sendContent_container'+mycars[i]).hide();
				$('.pushSOP_sendContentText_container'+mycars[i]).show();
			}else if(type == "图片"){
				$('.punlic_sendContent_container'+mycars[i]).hide();
				$('.pushSOP_sendContentImg_container'+mycars[i]).show();
			}else if(type == "链接"){
				$('.punlic_sendContent_container'+mycars[i]).hide();
				$('.pushSOP_sendContentLink_container'+mycars[i]).show();
			}
		}
	})
	let listData = 1;
	var mycars=new Array();
	mycars[0]=0;
	// 按钮1添加
	$('.pushSOP_leftButton_content button').click(function(){
		mycars[listData]=listData;
		$(".pushSOP_sendContentLink_container"+listData+"input" ).attr("border","none!important");
		$(".pushSOP_sendContentLink_container"+listData+"input" ).attr("outline","none");
		$(".pushSOP_sendContentLink_container"+listData+"input" ).attr("box-shadow","none");
		$(".pushSOP_sendContentLink_container"+listData+"input" ).attr("background","#fbfbfb");
		$(".pushSOP_sendContentLink_container"+listData+"input" ).attr("width","100%");
		$(".pushSOP_sendContentLink_container"+listData+"input" ).attr("height","32px");
		$(".pushSOP_sendContentLink_container"+listData+"input" ).attr("padding","4px 11px");
		$(".pushSOP_sendContentLink_container"+listData+"input" ).attr("color","rgba(0,0,0,.65)");
		$(".pushSOP_sendContentLink_container"+listData+"input" ).attr("font-size","14px");

		$('.pushSOP_message_container').append('<div class="pushSOP_message_content"><svg class="pushSOP_sendContentSvg" data-id="'+listData+'"  t="1607330001680"class="icon"viewBox="0 0 1024 1024"version="1.1"xmlns="http://www.w3.org/2000/svg"p-id="11923"width="16"height="16"><path d="M888 262.3H136.8c-17.9 0-32.4-14.5-32.4-32.4s14.5-32.4 32.4-32.4H888c17.9 0 32.4 14.5 32.4 32.4s-14.5 32.4-32.4 32.4z"fill="#666666"p-id="11924"></path><path d="M749.2 895.5H269.8c-45.4 0-82.3-36.9-82.3-82.3V257.6c0-17.9 14.5-32.4 32.4-32.4s32.4 14.5 32.4 32.4v555.7c0 9.5 8 17.5 17.5 17.5h479.4c9.5 0 17.4-8 17.4-17.5V257.6c0-17.9 14.5-32.4 32.4-32.4s32.4 14.5 32.4 32.4v555.7c0.1 45.3-36.8 82.2-82.2 82.2z"fill="#666666"p-id="11925"></path><path d="M386.5 709.6c-17.9 0-32.4-14.5-32.4-32.4V415.3c0-17.9 14.5-32.4 32.4-32.4s32.4 14.5 32.4 32.4v261.9c0 17.9-14.5 32.4-32.4 32.4zM509.5 709.6c-17.9 0-32.4-14.5-32.4-32.4V415.3c0-17.9 14.5-32.4 32.4-32.4s32.4 14.5 32.4 32.4v261.9c0 17.9-14.5 32.4-32.4 32.4zM632.6 709.6c-17.9 0-32.4-14.5-32.4-32.4V415.3c0-17.9 14.5-32.4 32.4-32.4s32.4 14.5 32.4 32.4v261.9c0 17.9-14.5 32.4-32.4 32.4zM660 249.9c-17.9 0-32.4-14.5-32.4-32.4v-41.6c0-12.7-10.3-23.1-23.1-23.1h-190c-12.7 0-23.1 10.3-23.1 23.1v41.6c0 17.9-14.5 32.4-32.4 32.4s-32.4-14.5-32.4-32.4v-41.6c0-48.5 39.4-87.9 87.9-87.9h190.1c48.5 0 87.9 39.4 87.9 87.9v41.6c0 17.9-14.5 32.4-32.5 32.4z"fill="#616161"p-id="11926"></path></svg><div class="pushSOP_sendNav_container"><p>消息1：</p><div class="pushSOP_sendNavRadio"><input type="radio"name="sendContent'+listData+'"value="文字"title="文字"checked=""class="sendContentRadio"><span>文字</span></div><div class="pushSOP_sendNavRadio"><input type="radio"name="sendContent'+listData+'"value="图片"title="图片"class="sendContentRadio"><span>图片</span></div><div class="pushSOP_sendNavRadio"><input type="radio"name="sendContent'+listData+'"value="链接"title="链接"class="sendContentRadio"><span>链接</span></div></div><div class="pushSOP_sendContent_content"><!--文字--><div class="pushSOP_sendContentText_container'+listData+' punlic_sendContent_container'+listData+'"><textarea name="text'+listData+'" style="width: 100%;height: 100%;border: none;resize: none;outline: none;font-size: 14px;font-weight: 400;color: rgba(0,0,0,.85);line-height: 20px;box-sizing: border-box;overflow: auto;background: #fbfbfb;" placeholder="请输入内容"></textarea></div><!--图片--><div class="pushSOP_sendContentImg_container'+listData+' punlic_sendContent_container'+listData+'"style="display: none;"><button type="button" class="layui-btn layui-btnssss" data-id="tt'+listData+'" id="test'+listData+'">上传图片</button><input type="file" hidden id="hide'+listData+'" /><div class="layui-upload-list"><img class="layui-upload-img" id="demo'+listData+'" style="width: 100px;"><input type="hidden" id="demos'+listData+'" name="file'+listData+'" /><p id="demoText'+listData+'"></p></div></div><!--链接--><div class="pushSOP_sendContentLink_container'+listData+' punlic_sendContent_container'+listData+'"style="display: none;" style="padding: 12px;height: 50px;box-sizing: border-box;background: #fbfbfb;border: 1px solid #eee;display: -webkit-box;display: flex;-webkit-box-align: center;align-items: center;min-height:50px;"><input type="text"name="url'+listData+'"placeholder="请输入链接"style="border: none!important;background: #fbfbfb;outline: none;box-shadow: none;width: 100%;height: 32px;padding: 4px 11px;color: rgba(0,0,0,.65);font-size: 14px;"></div></div></div>');
		listData ++
	})

$(".sub-tijiao").on("click",function(){
     parent.$(".creatSop_mainData_container").empty();
	var formData = $('#form1').serialize();	
	var params = decodeURIComponent(formData,true);
	myAjaxPost(false, true, 'add_sops.html', { params:params,mycars:mycars}, function (resp) {
		if(resp.status == 'success'){
		layer.msg(resp.msg);
		 var url = resp.data[0];
		 var file = resp.data[1];
		 var text = resp.data[2];
		 var output = resp.data[3];
		 var sui = resp.data[4];
		 var json = JSON.stringify(output);
		 var str = '';
			str += '<div class="creatSop_list_container_'+sui+'">';
			str += '<div class="creatSop_listTitle_container">';
			str += '<svg t="1607326862222" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4286" width="17" height="17"><path d="M111.68426667 274.97813333c-15.29173333 0-27.8528-12.56106667-27.8528-27.8528 0-5.46133333 1.6384-10.92266667 4.36906666-15.29173333 43.69066667-66.08213333 103.2192-122.33386667 172.032-161.65546667 13.1072-7.64586667 30.58346667-3.2768 38.22933334 10.37653334 7.64586667 13.1072 3.2768 30.58346667-10.37653334 38.22933333-61.16693333 34.95253333-114.14186667 85.1968-152.91733333 144.1792-5.46133333 7.64586667-14.19946667 12.01493333-23.48373333 12.01493333z m800.63146666 0c-9.28426667 0-18.0224-4.9152-23.48373333-12.56106666-38.77546667-58.9824-91.7504-108.68053333-152.91733333-144.1792-13.65333333-7.64586667-18.56853333-24.576-10.92266667-37.6832s24.576-18.56853333 37.6832-10.92266667c0.54613333 0 0.54613333 0.54613333 1.09226667 0.54613333 68.8128 39.3216 128.34133333 95.57333333 172.032 161.65546667 8.192 13.1072 4.9152 30.03733333-8.192 38.77546667-4.36906667 2.73066667-9.8304 4.36906667-15.29173334 4.36906666zM752.29866667 818.3808c-3.2768-3.2768-7.09973333-4.9152-10.92266667-6.5536 91.20426667-69.35893333 149.64053333-178.5856 149.64053333-301.4656 0-209.16906667-169.84746667-379.01653333-379.01653333-379.01653333-208.62293333 0-379.01653333 169.84746667-379.01653333 379.01653333 0 122.88 58.9824 232.10666667 149.64053333 301.4656-3.82293333 1.09226667-7.64586667 3.2768-10.92266667 6.5536l-76.45866666 76.45866667c-5.46133333 4.9152-8.192 12.01493333-8.192 19.6608 0 15.29173333 12.56106667 27.8528 27.8528 27.8528 7.09973333 0 14.19946667-2.73066667 19.6608-8.192l76.45866666-76.45866667c6.00746667-6.00746667 8.73813333-13.65333333 8.192-21.2992 56.79786667 33.86026667 122.33386667 52.97493333 192.78506667 52.97493333 70.4512 0 136.53333333-19.6608 193.3312-52.97493333-0.54613333 7.64586667 1.6384 15.29173333 7.64586667 21.2992l76.45866666 76.45866667c4.9152 5.46133333 12.01493333 8.192 19.6608 8.192s14.7456-2.73066667 19.6608-8.192a27.68853333 27.68853333 0 0 0 0-39.3216l-76.45866666-76.45866667z m-79.18933334-138.71786667c-5.46133333 5.46133333-12.56106667 8.192-19.6608 8.192-7.64586667 0-14.7456-2.73066667-19.6608-8.192L492.3392 538.2144c-5.46133333-5.46133333-8.192-12.56106667-8.192-19.6608V286.99306667c0-15.29173333 12.56106667-27.8528 27.8528-27.8528s27.8528 12.56106667 27.8528 27.8528v220.63786666L673.10933333 640.88746667c10.92266667 10.37653333 10.92266667 27.8528 0 38.77546666z" fill="#b4b9c3" p-id="4287"></path></svg>';
			if(output.time == "next"){
				str += '<h4>客户添加企业客服后'+output.tianshu+'天后,当日'+output.shijian+'提醒发送（'+output.topname+'）</h4>';
			}
			if(output.time == "now"){
				str += '<h4>客户添加企业客服后'+output.xiaoshi+'小时'+output.fenzhong+'分钟提醒发送（'+output.topname+'）</h4>';
			}
			str +='<input type="hidden" name="json" id="outputs'+sui+'" value='+json+'>';
			str += '</div>';
			str += '<div class="creatSop_list_content">';
			str += '<ul>';
			//文字 
			if(text){
				text.forEach(function(wenben) {
					str += '<li class="creatSop_list_bg">';
					str += '<span>内容：'+wenben+'</span>';
					str += '</li>';
				});
			}
			//图片
			if(file){
				file.forEach(function(image) {
					str += '<li>';
					str += '<img src="'+image+'">';
					str += '</li>';
				})
			}
			//链接
			if(url){
				url.forEach(function(url) {
					str += '<li class="creatSop_list_bg">';
					str += '<a href="'+url+'">'+url+'</a>';
					str += '</li>';
				})
			}
			str += '</ul>';
			str += '<div class="creatSop_listAbsolute_container">';
			str += '<div class="creatSop_listAbsolute_content">';
			str += '<svg class="pushSOP_sendContentSvgshhsh" t="1607330001680" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11923" width="16"onclick="delsop('+sui+')" height="16"><path d="M888 262.3H136.8c-17.9 0-32.4-14.5-32.4-32.4s14.5-32.4 32.4-32.4H888c17.9 0 32.4 14.5 32.4 32.4s-14.5 32.4-32.4 32.4z" fill="#666666" p-id="11924"></path><path d="M749.2 895.5H269.8c-45.4 0-82.3-36.9-82.3-82.3V257.6c0-17.9 14.5-32.4 32.4-32.4s32.4 14.5 32.4 32.4v555.7c0 9.5 8 17.5 17.5 17.5h479.4c9.5 0 17.4-8 17.4-17.5V257.6c0-17.9 14.5-32.4 32.4-32.4s32.4 14.5 32.4 32.4v555.7c0.1 45.3-36.8 82.2-82.2 82.2z" fill="#666666" p-id="11925"></path><path d="M386.5 709.6c-17.9 0-32.4-14.5-32.4-32.4V415.3c0-17.9 14.5-32.4 32.4-32.4s32.4 14.5 32.4 32.4v261.9c0 17.9-14.5 32.4-32.4 32.4zM509.5 709.6c-17.9 0-32.4-14.5-32.4-32.4V415.3c0-17.9 14.5-32.4 32.4-32.4s32.4 14.5 32.4 32.4v261.9c0 17.9-14.5 32.4-32.4 32.4zM632.6 709.6c-17.9 0-32.4-14.5-32.4-32.4V415.3c0-17.9 14.5-32.4 32.4-32.4s32.4 14.5 32.4 32.4v261.9c0 17.9-14.5 32.4-32.4 32.4zM660 249.9c-17.9 0-32.4-14.5-32.4-32.4v-41.6c0-12.7-10.3-23.1-23.1-23.1h-190c-12.7 0-23.1 10.3-23.1 23.1v41.6c0 17.9-14.5 32.4-32.4 32.4s-32.4-14.5-32.4-32.4v-41.6c0-48.5 39.4-87.9 87.9-87.9h190.1c48.5 0 87.9 39.4 87.9 87.9v41.6c0 17.9-14.5 32.4-32.5 32.4z" fill="#616161" p-id="11926"></path></svg>';
			str += '<svg class="editPopup" onclick="updsop('+sui+')" t="1607329960572" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6491" width="16" height="16"><path d="M684.202667 117.248c15.893333-15.872 42.154667-15.36 58.922666 1.408l90.517334 90.517333c16.661333 16.661333 17.344 42.986667 1.429333 58.922667l-445.653333 445.653333c-7.936 7.914667-23.104 16.746667-34.218667 19.776l-143.701333 39.253334c-21.909333 5.994667-35.114667-7.104-29.568-28.949334l37.248-146.773333c2.773333-10.944 11.562667-26.346667 19.392-34.176l445.653333-445.653333zM268.736 593.066667c-2.901333 2.901333-8.106667 12.074667-9.130667 16.021333l-29.12 114.773333 111.957334-30.570666c4.437333-1.216 13.632-6.549333 16.810666-9.728l445.653334-445.653334-90.517334-90.496-445.653333 445.653334zM682.794667 178.986667l90.517333 90.517333-30.186667 30.186667-90.496-90.517334 30.165334-30.165333z m-362.026667 362.048l90.496 90.517333-30.165333 30.165333-90.517334-90.496 30.165334-30.186666zM170.666667 874.666667c0-11.776 9.429333-21.333333 21.461333-21.333334h661.077333a21.333333 21.333333 0 1 1 0 42.666667H192.128A21.333333 21.333333 0 0 1 170.666667 874.666667z" fill="#616161" p-id="6492"></path></svg>';
			str += '</div>';
			str += '</div>';
			str += '</div>';
			str += '</div>';
			parent.$(".creatSop_mainData_container").after(str);
			parent.$("#hiden").val(output);
			parent.layer.closeAll('iframe');
		}else{
			layer.msg(resp.msg);
		}
	})
})
$('.pushSOP_message_container').on('click','.layui-btnssss',function(e){
	for (var q = 0; q<mycars.length; q++) {
		if($(this).data("id") == 'tt'+mycars[q]){
			$("#hide"+mycars[q]).trigger("click");
        	openuploadsone(mycars[q]);
		}
		function openuploadsone(id) {
        $("#hide"+id).change(function () {
            var formdata = new FormData();
            formdata.append('file', $("#hide"+id)[0].files[0]); //获取file信息
            $.ajax({
                url: "add_file.html",
                type: 'post',
                data: formdata,
                cache: false,
                dataType: 'json',
                processData: false,
                contentType: false,
                success: function (e) {
                    if (e.status == "success") {
                        layer.msg(e.msg, '');
                        var data = e.data.filePath;
                        $("#demo"+id).attr('src',data);
                        $("#demos"+id).attr('value',data);
                    } else {
                        layer.msg(e.msg, '');
                    }
                }
            });
        });
    }
		
	}
})
$(".quxiaosss").on("click",function(){
	parent.layer.closeAll('iframe');
})
			
</script>
</body>
</html>

